extends Card


func play_on_release(card_view: CardView) -> void:
	var monster: Monster = Globals.current_monster
	var player = card_view.get_tree().get_first_node_in_group("player")
	player.play_animation("attack")
	var mtween: Tween = monster.create_tween()
	mtween.tween_callback(Shake.shake.bind(monster, 16, 0.2))
	mtween.tween_interval(0.21)
	mtween.tween_callback(
		func(): Events.take_damage.emit(player, monster, get_final_damage(monster.state))
	)
	await mtween.finished
	player.play_animation("default")
	card_view.play_on_release_signal_finish.emit()


func get_desc() -> String:
	if desc_lab == "":
		return ""
	var text = desc_lab % get_final_damage_str()
	return text


func init_from_csv(introduce):
	super.init_from_csv(introduce)
	self.damage = int(introduce[5])
